<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>微博编辑</title>
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/microblog_edit.css">

    <!-- 引入 editor.md 的依赖 -->
    <link rel="stylesheet" href="editor.md/css/editormd.min.css" />
    <script src="js/jquery.min.js"></script>
    <script src="editor.md/lib/marked.min.js"></script>
    <script src="editor.md/lib/prettify.min.js"></script>
    <script src="editor.md/editormd.js"></script>
</head>
<body>
<div class="nav">
    <img src="image/微博图标.jpeg" alt="">
    <span class="title">微博管理系统</span>
    <span class="spacer"></span>
    <a href="microblog_search.html">搜索</a>
    <a href="microblog_list.html">新鲜事</a>
    <a href="microblog_edit.html">写微博</a>
    <a href="logout">退出</a>
</div>

<div class="blog-edit-container">
    <form action="blog" method="post" style="height: 100%">
        <!-- 标题编辑区 -->
        <div class="title">
            <input type="text" id="title" placeholder="在这里写下吸引人的标题" name="title">
            <input type="submit" id="submit" value="发布微博">
        </div>
        <!-- 博客编辑器标签 -->
        <div id="editor">
            <!-- editor.md 库的要求 -->
            <textarea name="content" style="display: none;"></textarea>
        </div>
    </form>
</div>

<script>
    // 初始化编辑器
    var editor = editormd("editor", {
        width: "100%",
        // 设定编辑器高度
        height: "calc(100% - 50px)",
        // 编辑器中的初始内容
        markdown: "# 快来发布你的新鲜事吧~",
        // 指定 editor.md 依赖的插件路径
        path: "editor.md/lib/",
        saveHTMLToTextArea: true,
    });
</script>
</body>
</html>